cmake_minimum_required(VERSION 3.22)
project(test)
#set(SRC add.cpp div.cpp mult.cpp main.cpp sub.cpp)

# PROJECT_SOURCE_DIR 这个宏表示的就是执行 cmake 后面跟随的路径
# aux_source_directory(${PROJECT_SOURCE_DIR}/src SRC) 也是用来搜索文件的


#GLOB作用：通过通配符匹配文件，并将匹配到的文件列表存储到变量中。

file(GLOB SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
#set(EXECUTABLE_OUTPUT_PATH /home/sx/linux/cmake-practice/exec)
message("=====================")
message(${SRC})
list(REMOVE_ITEM SRC ${PROJECT_SOURCE_DIR}/src/main.cpp)
message("=====================")
message(${SRC})
message("=====================")




#包含头文件路径 找到头文件
include_directories(${PROJECT_SOURCE_DIR}/include)

# set(CMAKE_CXX_STANDARD 11)
# add_executable(app ${SRC})
# add_library(calc SHARED ${SRC})

#指定生成库路径
set(LIBRARY_OUTPUT_PATH /home/sx/linux/cmake-practice/lib)
add_library(calc SHARED ${SRC})

#字符串的追加 与 拼接
set(tmp hello world)
set(tmp1 ${tmp} ${SRC})
message(${tmp})
message(${tmp1})
list(APPEND tmp "xxx1" "ssss2" ${SRC})
message(${tmp})